﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Order_details.aspx.cs" Inherits="WeChat.MenuReservation.Order_details" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>订单详情</title>
<%--    <script src="../Script/rem.js"></script>
    <script src="../Script/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <link rel="stylesheet" type="text/css" href="../css/page.css" />
    <link rel="stylesheet" type="text/css" href="../css/all.css" />
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/loaders.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/loading.css" />
    <script src="../Script/jquery-1.8.3.min.js"></script>
    <link href="../Script/slick/slick.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css" />
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>--%>


        <script src="../Script/rem.js"></script>
    <script src="../Script/jquery.min.js" type="text/javascript"></script>
    <script src="../Script/jquery-1.8.3.min.js?v=1.1"></script>
    <script src="../Scripts/mobiscroll-2.13.2.full.min.js?v=1.2"></script>
    <link href="../Content/mobiscroll-2.13.2.full.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <link rel="stylesheet" type="text/css" href="../css/page.css"  />
    <link rel="stylesheet" type="text/css" href="../css/all.css" />
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/loaders.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/loading.css" />
    <link href="../Script/slick/slick.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css" />
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="../Script/JquerySession.js"></script>
    <script src="../Script/mui.min.js"></script>

    <script src="../Script/others.js"></script>
    <script type="text/javascript" src="../Script/hmt.js"></script>
    <script src="../Script/slick/slick.js" type="text/javascript"></script>
    <script src="../Script/shopcar.js"></script>
    <!--插件-->
    <link rel="stylesheet" href="../css/swiper.min.css" />
    <script src="../Script/swiper.jquery.min.js"></script>
    <script src="../Script/iconfont.js"></script>
    <link href="../Script/iconfont.css" rel="stylesheet" />
    <link href="../Script/slick/iconfont.css" rel="stylesheet" />
    <script src="../Script/slick/iconfont.js"></script>



</head>
<body>
    <div id="divmax">
        <h1 style="margin: auto; text-align: center; margin-top: 80px; font-size: 60px;">订单详情页面</h1>
        <br/>
        <br/>
        <br/>
        <div id="content" style="width: 80%;margin: auto;">
        </div>
        <br/>
        <div>
            <table style="width: 80%; margin: auto;line-height: 70px;font-size: 38px;">
                <tr>
                    <th style="float: left"></th>
                    <td style="float: right">合计：￥<span id="span01">0</span> 元</td>
                </tr>
                <tr>
                    <th style="float: left">期望时间：</th>
                    <td style="float: right"><span id="span02">0</span></td>
                </tr>
                <tr>
                    <th style="float: left">配送地址：</th>
                    <td style="float: right"><span id="span03">0</span></td>
                </tr>
                <tr>
                    <th style="float: left">手机号码：</th>
                    <td style="float: right"><span id="span04">0</span></td>
                </tr>
                <tr>
                    <th style="float: left">订单号码：</th>
                    <td style="float: right"><span id="span05">0</span></td>
                </tr>
                <tr>
                    <th style="float: left">下单时间：</th>
                    <td style="float: right"><span id="span06">0</span></td>
                </tr>
                <tr>
                    <th style="float: left">支付方式：</th>
                    <td style="float: right"><span id="span07">0</span></td>
                </tr>
            </table>
        </div>
        <br/>
        <br/>
        <br/>
        <div style="width:100%; margin:auto; line-height:150px; font:40px; display:inline-block; "><a href="javascript:history.go(-1)" style="display:block; width:100%; text-align:center;border: 1px solid #007aff;background: #007aff;color: #fff;font-size: 40px;">返    回</a></div>
    </div>
</body>

<%--<script type="text/javascript" src="../Script/jquery-1.8.3.min.js"></script>
<script src="../Script/fastclick.js"></script>
<script src="../Script/mui.min.js"></script>
<script type="text/javascript" src="../Script/hmt.js"></script>--%>

<script type="text/javascript">
    $(function () {

        //   var orderid = getUrlParam('orderid');


        var searchUrl = window.location.href;
        var searchData = searchUrl.split("="); //截取 url中的“=”,获得“=”后面的参数
        var orderid = decodeURI(searchData[1]); //decodeURI解码


        console.log("获取到请求参数：" + orderid);
        $.ajax({
            url: "../AjaxSets.ashx",
            type: "post",
            data: { orderid: orderid, functionName: "get_orderdetail" },
            success: function (data) {
                
                if (data == null) return;
                data = $.parseJSON(data);
                var item = $.parseJSON(data.baseInfo);
                $("#empty").remove();
                if (item == null || item == "") {

                    console.log("进入到01");
                    $("#content").prepend('<div style="text-align:center;padding-top:3rem;" id="empty"><img src="../images/caip.png" style="width:2rem;"/><p style="padding-top:.3rem">商家未提供该时间段商品</p></div>');
                }
                else {
                    console.log("进入到02");
                        for (var i = 0; i < item.length; i++) {
                            var menuName = item[i].name;
                            var price = item[i].price;
                            var Image = item[i].image;
                            var TotalPrice = item[i].TotalPrice;
                            var OrderNum = item[i].OrderNum;

                            var str = item[i].PayTime;
                            var tmp = /\d+(?=\+)/.exec(str);
                            var d = new Date(+tmp);
                            var reservationdate = d.getFullYear() + '-' + (+d.getMonth() + 1) + '-' + d.getDate();

                            $("#span01").html(TotalPrice.toFixed(2));
                            $("#span02").html(item[i].address1);
                            $("#span03").html(item[i].address);
                            $("#span04").html(item[i].telnum);
                            $("#span05").html(item[i].OrderId);
                            $("#span06").html(reservationdate);
                            $("#span07").html(item[i].payType);
                          //  $("#content").prepend('<div class="bottom clearfloat" name="menus"  style=" margin: auto;line-height: 70px;font-size: 38px;"> <span> <div style="float:left;"><img src="../' + Image + '" style="width:30%;" /></span> <span style="float:right;"><p class="tit" style="float:left;padding-right: 180px;">' + menuName + '</p> <p class="jifen fl over" style="float:right;">￥' + price + "*" + OrderNum + '</p>                </span ></div ></div>');

                            
                            $("#content").prepend('<div class="bottom clearfloat" name="menus" > <div class="lie clearfloat"> <a href="#"><div class="tu clearfloat fl"><img src="../' + Image + '" style="width: 200px;height: 180px;" /></div></a><div class="right clearfloat fl">         <a href="#" style="display: block;font-size: 40px;padding-left: 20px;"><p class="tit">' + menuName + '</p></a style="display: block;font-size: 40px;padding-left: 20px;"> <div class="xia clearfloat">          <a href="#" style="display: block;font-size: 40px;padding-left: 20px;"><p class="jifen fl over">￥' + price + "*" + OrderNum + '</p>  </a>                       </div>  </div ></div ></div>');
                        }

                }


            },
            error: function (data) {
                alert("异常！");
            }
        });

    });
</script>

</html>
